package controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import tagger.VietnameseTagger;

/**
 * Servlet implementation class TrueTest
 */
@WebServlet("/TrueTest")
public class TrueTest extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset=UTF-8");
		String para = request.getParameter("text");
		String result = VietnameseTagger.tagFromString(new String(para.getBytes("8859_1"), "UTF8"));
		request.setAttribute("result", result);
		request.getRequestDispatcher("test.jsp").forward(request, response);
	}

}
